updating oE read_bitmap

Bitmap Handling

read_bitmap

include image.e 
namespace image 
public function read_bitmap(sequence file_name) 

reads a bitmap (.BMP) file into a 2-d sequence of sequences (image)

Parameters:
  1. file_name : a sequence, the path to a .bmp file to read from. The extension is not assumed if missing.
Returns:

An object, on success, a sequence of the form {palette,image}. On failure, an error code is returned.

Comments:

In the returned value, the first element is a list of three membered sequences, each containing three color intensity values in the range 0 to 255, and the second, a list of pixel rows. Each pixel in a row is represented by its color index in the said first element of the return value.

The file should be in the bitmap format. The most common variations of the format are supported.

Bitmaps of 2, 4, 16 or 256 colors are supported. If the file is not in a good format, an error code (atom) is returned instead

public constant 
    BMP_OPEN_FAILED = 1, 
    BMP_UNEXPECTED_EOF = 2, 
    BMP_UNSUPPORTED_FORMAT = 3 

You can create your own bitmap picture files using Windows Paintbrush and many other graphics programs. You can then incorporate these pictures into your Euphoria programs.

Example 1:
x = read_bitmap("c:\\windows\\arcade.bmp") 
See Also:

save_bitmap

Not Categorized, Please Help

Search



Quick Links

User menu

Not signed in.

Misc Menu